package factory.pattern.demo;

public class FactoryPatternEx {
    public static void main(String[] args) throws Exception {
        System.out.println("****Factory Pattern Demo***");
        IAnimalFactroy animalFactroy = new ConCreateFactory();
        IAnimal duck = duck = animalFactroy.getAnimalType("Duck");

        duck.speak();

        IAnimal tiger = animalFactroy.getAnimalType("Tiger");
        tiger.speak();
    }
}
